import { connect } from 'react-redux';
import Count from '../../components/count';
import {
  createIncrementAction,
  createDecrementAction,
  createIncrementAsyncAction
} from '../../redux/count_action';

function mapStateToProps(state) {
  return {
    count:state
  }
}
function mapDispatchToProps(dispatch) {
  return {
    add:number=>dispatch(createIncrementAction(number)),
    jian:number=>dispatch(createDecrementAction(number)),
    addAsync:(number,time)=>dispatch(createIncrementAsyncAction(number,time))
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(Count)
